'use strict';
const keyContrulor = require('./../lib/keyContrulor');


const Controller = require('egg').Controller;

class UserController extends Controller {
  async index() {
    const { ctx } = this;
    ctx.body = 'hi, egg';
  }
  async getPublicKey() {
    const { ctx } = this;
    const { publicKey } = await keyContrulor.getKeys();
    ctx.body = JSON.stringify({
      success: true,
      msg: '',
      data: publicKey,
    });
  }
}

module.exports = UserController;
